package com.halley.springcloudconsumer.config;

import com.halley.springcloudconsumer.service.HelloService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class HelloServiceFallbackFactory implements FallbackFactory<HelloService> {
    @Override
    public HelloService create(Throwable throwable) {
        return new HelloService() {
            @Override
            public String hello(String name) {
                return "超时了，哈哈哈哈，请等会再来";
            }
        };
    }
}
